Repository navigation
ci(lint): adopt golangci-lint v2.14.0 tooling and strict lint config - #46
Merged
Merged
Conversation
- Add .golangci.yml based on the signet strict configuration with module-specific gci prefix - Add Makefile with lint, fmt, test, coverage and mod targets - Pin golangci-lint v2.14.0 via go.tools.mod with tool directive - Replace golangci-lint-action with make install-tools lint in CI workflow - Apply automated lint fixes: modernize, usestdlibvars, perfsprint, testifylint - Keep public API names unchanged via nolint directives for backward compatibility - Replace os.MkdirTemp with t.TempDir in tests - Clean up dead code and unused imports flagged by staticcheck and govet 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Code <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The tooling integration is consistent and the source changes preserve existing behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Adopts project-managed golangci-lint v2.14.0 tooling and applies lint-driven, behavior-preserving cleanup.
Changes:
- Adds pinned lint tooling, Make targets, and strict lint/format configuration.
- Updates CI to invoke the project-managed linter.
- Applies formatting and modernization fixes across implementation and tests.
| File | Description |
|---|---|
.github/workflows/go.yml |
Runs lint through Make. |
.golangci.yml |
Defines strict v2 lint and formatting rules. |
Makefile |
Adds development and CI targets. |
go.tools.mod |
Pins golangci-lint tooling. |
go.tools.sum |
Locks tool dependencies. |
authenticator.go |
Modernizes header lookup logic. |
authenticator_test.go |
Applies formatting and test assertion improvements. |
signatureheader_test.go |
Formats cases and uses HTTP constants. |
crypto/crypto.go |
Groups same-type parameters. |
crypto/hmacsha256.go |
Groups same-type parameters. |
crypto/hmacsha512.go |
Groups same-type parameters. |
validator/datevalidate.go |
Simplifies error-string construction. |
validator/digestvalidate.go |
Removes unreachable error handling and simplifies formatting. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adopt project-managed golangci-lint tooling (same approach as go-signet/signet) across build, lint config, and CI:
flowchart LR A[go.tools.mod<br/>pin golangci-lint v2.14.0] --> B[Makefile<br/>make lint / make fmt] B --> C[.golangci.yml<br/>strict v2 config] C --> D[GitHub Actions<br/>make install-tools lint] D --> E[Code fixes<br/>0 lint issues]Additions
.golangci.yml— strict golangci-lint v2 configuration (bidichk, gocritic, modernize, revive, testifylint, perfsprint, staticcheck, etc.) with module-specificgciimport orderingMakefile—lint,fmt,test,coverage,mod-download/tidy/verify,install-tools,helptargetsgo.tools.mod/go.tools.sum— pin golangci-lint v2.14.0 via Gotooldirective, executed withgo tool -modfile=go.tools.modCI changes
golangci/golangci-lint-actionwithmake install-tools lintso local and CI use the exact same pinned versionCode fixes (all lint issues resolved: 0 issues)
modernize(interface{} → any, range over int, maps.Copy),usestdlibvars(http.MethodGet),perfsprint,testifylint(assert → require),usetesting(os.MkdirTemp → t.TempDir)//nolintdirectives with explanations for backward compatibilityAI Authorship Disclosure
🤖 This change was prepared with AI assistance. Generated with Claude Code.
Change Classification
ci(tooling/CI) +style/refactor(lint fixes)Checklist
make lintpasses with 0 issues